package com.yunhe.authority.service.base;

import com.yunhe.authority.domain.base.MessageCenter;
import com.yunhe.authority.model.base.*;
import com.yunhe.common.model.PageParam;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName MessageCenterService
 * @Description TODO
 * @Author HeTao
 * @Date 2021/10/18 17:52
 * @Version 1.0
 **/
public interface MessageCenterService {


    /**
     * 新增
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    public MessageCenter createMessageCenter(MessageCenter messageCenter);

    /**
     * 删除
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    public void deleteMessageCenter(Long id);

    /**
     * 更新
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    public MessageCenter updateMessageCenter(MessageCenter messageCenter);

    /**
     * 根据主键 id 查询
     */
    public MessageCenter findMessageCenterById(Long id);

    /**
     * 查询app消息通知
     * @return
     * @param pageParam
     */
    Iterable<MessageCenterVo> findAppMessage(PageParam pageParam);

    /**
     * 查询小程序企业用户个人消息
     * @return
     * @param messageQueryCondition
     */
    Iterable<MessageCenterVo> findWeChatMessage(MessageQueryCondition messageQueryCondition);

    /**
     * 批量新增
     * @param messageCenters
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void batchCreateMessageCenter(List<MessageCenter> messageCenters);

    MessageReadCount getMessageCountByCondition(Long businessId, String messageType);

    Iterable<MessageReadVo> findMessageByCondition(WhetherReadQueryCondition whetherReadQueryCondition);
}
